<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="./img/asset-favicon.ico">
    <title>头条详情</title>

    <!-- 页面 css js -->
    <!-- <script type="text/javascript" src="../../plugins/sui/sui.min.js"></script> -->

    <link rel="stylesheet" type="text/css" href="./plugins/normalize-css/normalize.css"/>
    <link rel="stylesheet" type="text/css" href="./plugins/yui/cssgrids-min.css"/>
    <link rel="stylesheet" type="text/css" href="./plugins/sui/sui.min.css"/>
    <link rel="stylesheet" type="text/css" href="./plugins/sui/sui-append.min.css"/>
    <link rel="stylesheet" type="text/css" href="./plugins/font-awesome/css/font-awesome.min.css"/>
    <link rel="stylesheet" type="text/css" href="./css/widget-base.css"/>
    <link rel="stylesheet" type="text/css" href="./css/widget-head-foot.css"/>
    <link rel="stylesheet" type="text/css" href="./css/page-sj-headline-detail.css"/>

</head>

<body>
<div id="app">
    <div class="wrapper">
        <!--引用组件-->
        <!--头部导航-->
        <header>
            <div class="sui-navbar">
                <div class="navbar-inner">
                    <a href="index.html" class="sui-brand"><img src="./img/asset-logo-black.png" alt="社交"/></a>
                    <ul class="sui-nav">
                        <li class="active"><a href="./index.html">头条</a></li>
                        <li><a href="./qa-logined.html">问答</a></li>
                        <li><a href="./activity-index.html">活动</a></li>
                        <li><a href="./makeFriends-index.html">交友</a></li>
                        <li><a href="./spit-index.html">吐槽</a></li>
                        <li><a href="./recruit-index.html">招聘</a></li>
                    </ul>
                    <form class="sui-form sui-form pull-left">
                        <input type="text" placeholder="输入关键词...">
                        <span class="btn-search fa fa-search"></span>
                    </form>

                    <div class="sui-nav pull-right info" v-if=token>
                        <li><a href="./other-notice.html" target="_blank" class="notice">通知</a></li>
                        <li class="hover">
                            <span class="fa fa-plus "></span>
                            <ul class="hoverinfo">
                                <li><i class="fa fa-share-alt" aria-hidden="true"></i> <a
                                        href="./headline-submit.html">去分享</a></li>
                                <li><i class="fa fa-question-circle" aria-hidden="true"></i> <a href="./qa-submit.html"
                                                                                                target="_blank">提问题</a>
                                </li>
                                <li><i class="fa fa-comments" aria-hidden="true"></i><a href="./spit-submit.html"
                                                                                        target="_blank">去吐槽</a></li>
                                <li><i class="fa fa-heartbeat" aria-hidden="true"></i> <a
                                        href="./makeFriends-submit.html"
                                        target="_blank">发约会</a></li>
                            </ul>
                        </li>
                        <li><a href="./person-homepage.html" target="_blank" class="homego"><img
                                src="./img/widget-photo.png" alt="用户头像"></a></li>
                    </div>

                    <div class="sui-nav pull-right info" v-else>
                        <li><a href="person-loginsign.html">注册</a></li>
                        <li><a href="person-loginsign.html" class="sui-btn btn-login">登录</a></li>
                    </div>

                </div>
            </div>

        </header>


    </div>
    <!--两列布局-->
    <div class="wrapper headline-content">
        <div class="fl left-list">
            <div class="problem-detail">
                <!-- title area  -->
                <div class="title-intro">
                    <h2>{{ results.title }}</h2>
                    <div class="operate">
                    <span class="fl author">{{ results.source }}
                        <span class="time">  {{ results.create_time | str2date | date2MDhm }}</span>
                    </span>
                        <span class="fr ">收藏</span>
                    </div>
                    <div class="clearfix"></div>
                    <div class="content"><span v-html="results.content"></span></div>
                </div>
                <!-- remark area -->
                <div class="answer-intro">
                    <h4 class="answer-num">{{ count }}条评论</h4>
                    <div class="comment-box">
                        <form class="comment-form sui-form form-inline">
                            <img :src='avatar' alt="">
                            <div class="input-prepend input-append input-box">
                                <textarea id="appendedPrependedInput" type="text" class="span2 input-fat real-box"
                                          v-model="main_comment" placeholder="写下你的评论"></textarea>
                                <span class="add-on" style="cursor:pointer;"
                                      @click="create_comment">提交</span>
                            </div>
                        </form>
                    </div>
                    <div class="remark-list">
                        <!--父评论-->
                        <ul class="lists">
                            <li class="item" v-for="(comment,index) in com_data">
                                <div class="fl img">
                                    <img src="./img/widget-photo.jpg" alt="">
                                </div>
                                <!--评论-->
                                <div class="fl text">
                                    <p class="author"><span>{{ comment.user.username }}</span> 发布于 <span
                                            class="name">{{ comment.update_time | str2date | date2MDhm }}</span></p>
                                    <p class="word">{{ comment.content }}</p>
                                    <p class="tool"><a class="callback" onclick="show(this)"
                                                       style="color: #406599">回复</a>&nbsp;&nbsp;&nbsp;&nbsp;<span
                                            class="remark-num" @click="my_switch(index)" style="cursor:pointer; color: #406599"
                                            v-if="comment.sub.length > 0">{{ comment.present }} </span>
                                    </p>
                                </div>
                                <div style="clear:both"></div>
                                <div class="edit-box">
                                    <form class="comment-form">
                                        <textarea row="1" placeholder="使用评论询问更多信息或提出修改意见，请不要在评论里回答问题"
                                                  v-model="sub_comment"></textarea>
                                        <span class="sui-btn submit-comment" @click="on_submit(comment)"
                                              onclick="hide(this)">提交评论</span>
                                    </form>
                                </div>
                                <ul class="inner-list" v-for="innerCom in comment.sub">
                                    <li class="item" v-if="comment.show_sub">
                                        <div class="fl img">
                                            <img src="./img/widget-photo.jpg" alt="">
                                        </div>
                                        <div class="fl text">
                                            <p class="author"><span>{{ innerCom.user.username }}</span> 发布于 <span
                                                    class="name">{{ innerCom.update_time | str2date | date2MDhm }}</span>
                                            </p>
                                            <p class="word">{{ innerCom.content }}</p>
                                            <p class="tool"><a class="callback" style="color: #406599"
                                                               onclick="show(this)">回复</a></p>
                                        </div>
                                        <div style="clear:both"></div>
                                        <div class="edit-box">
                                            <form class="comment-form">
                                                <textarea row="1"
                                                          placeholder="使用评论询问更多信息或提出修改意见，请不要在评论里回答问题"
                                                          v-model="sub_comment"></textarea>
                                                <span class="sui-btn submit-comment"
                                                      @click="on_submit(comment)" onclick="hide(this)">提交评论
                                                </span>
                                            </form>
                                        </div>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="fl right-tag">
            <div class="focus similar-problem">
                <div class="img-title">
                    <div class="fl img">
                        <img src="./img/widget-photo.jpg" alt="">
                    </div>
                    <div class="fl btn-focus">
                        <h4>{{ author }}</h4>
                        <button class="sui-btn btn-info btn-attention">关注</button>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <ul class="problem-list">
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                </ul>
            </div>
            <div class="similar-problem">
                <h3 class="title">热门推荐</h3>
                <ul class="problem-list">
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                </ul>
            </div>
            <div class="similar-problem">
                <h3 class="title">热门吐槽</h3>
                <ul class="problem-list">
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                    <li class="list-item">
                        <p class="list-title">如果你还是象棋新手，学会这些套路，你就可以去破残局赚钱了！</p>
                    </li>
                </ul>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="footer">
        <div class="wrapper">
            <div class="footer-bottom">
                <div class="link">
                    <dl>
                        <dt>网站相关</dt>
                        <dd>关于我们</dd>
                        <dd>服务条款</dd>
                        <dd>帮助中心</dd>
                        <dd>编辑器语法</dd>
                    </dl>
                    <dl>
                        <dt>常用链接</dt>
                        <dd>传智播客</dd>
                        <dd>传智论坛</dd>
                    </dl>
                    <dl>
                        <dt>联系我们</dt>
                        <dd>联系我们</dd>
                        <dd>加入我们</dd>
                        <dd>建议反馈</dd>
                    </dl>
                    <dl>
                        <dt>关注我们</dt>
                        <dd>微博</dd>
                        <dd>twitter</dd>
                    </dl>

                    <div class="xuke">
                        <h3>内容许可</h3>
                        <p>除特别说明外，用户内容均采用知识共享署名-非商业性使用-禁止演绎4.0 国际许可协议 (CC BY-NC-ND 4.0) 进行许可</p>
                        <p>本站由 传智研究院 提供更新服务</p>
                    </div>
                </div>


                <p class="Copyright">Copyright © 2017 传智问答社区 当前版本 0.0.1</p>
            </div>
        </div>

    </div>


</div>
<script type="text/javascript" src="js/vue-2.5.16.js"></script>
<script type="text/javascript" src="js/axios-0.18.0.min.js"></script>
<script type="text/javascript" src="js/base.js"></script>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/detail.js"></script>
<script type="text/javascript">

    function show(index) {
        if ($(index).parent().parent().next().next().css('display') === 'none') {
            $(index).text('收起');
            $(index).parent().parent().next().next().css('display', 'block');
        } else {
            $(index).text('回复');
            $(index).parent().parent().next().next().css('display', 'none');
        }
    }

    function change(index) {
        alert(123)
        if ($(index).parent().parent().sibling('.inner-list').children().css('display') === 'none') {
            alert(1)
            $(index).text('收起');
            $(index).parent().parent().sibling('.inner-list').children().css('display', 'block');
        } else {
            alert(0)
            $(index).text('{{ }}条回复');
            $(index).parent().parent().sibling('.inner-list').children().css('display', 'none');
        }
    }

    function hide(index) {
        $(index).parent().parent().css('display', 'none');
        $(index).parent().parent().siblings('.text').children('.tool').children('.callback').text('回复')
    }


</script>
</body>
